import {createRouter, createWebHashHistory} from 'vue-router'

import MerchandisePage from '@/components/MerchandisePage.vue'
import Merchandise from '@/components/Merchandise.vue'
import Category from '@/components/Category.vue'

import SalesPage from '@/components/SalesPage.vue'
import Cashier from '@/components/Cashier.vue'
import Sales from '@/components/Sales.vue'

import WarehousePage from '@/components/WarehousePage.vue'
import Goods from '@/components/Goods.vue'

import MembershipPage from '@/components/MembershipPage.vue'
import Membership from '@/components/Membership.vue'

import SupplierPage from '@/components/SupplierPage.vue'
import Supplier from '@/components/Supplier.vue'

import EmployeePage from '@/components/EmployeePage.vue'
import Employee from '@/components/Employee.vue'

import FinancePage from '@/components/FinancePage.vue'
import FinanceChart from '@/components/FinanceChart.vue'
import FinanceCast from '@/components/FinanceCost.vue'

import SettingPage from '@/components/SettingPage.vue'
import SettingPerson from '@/components/SettingPerson.vue'
import SettingPassword from '@/components/SettingPassword.vue'
import SettingSystem from '@/components/SettingSystem.vue'

const router = createRouter(
    {
        history: createWebHashHistory(),
        routes:[

            // 商品管理
            {  
                path: '/MerchandisePage', 
                component: MerchandisePage, 
                children: [
                    { path: '', component: Merchandise },
                    { path: '/Merchandise', component: Merchandise },
                    { path: '/Category', component: Category },
                ] 
            },

            // 仓库管理
            {  
                path: '/WarehousePage', 
                component: WarehousePage, 
                children: [
                    { path: '', component: Goods },
                    { path: '/Goods', component: Goods },
                ] 
            },

            // 收银管理
            {  
                path: '/SalesPage', 
                component: SalesPage, 
                children: [
                    { path: '', component: Cashier },
                    { path: '/Cashier', component: Cashier },
                    { path: '/Sales', component: Sales },
                ] 
            },

            // 会员管理
            {  
                path: '/MembershipPage', 
                component: MembershipPage, 
                children: [
                    { path: '', component: Membership },
                    { path: '/Membership', component: Membership },
                ] 
            },

            // 供应商管理
            {  
                path: '/SupplierPage', 
                component: SupplierPage, 
                children: [
                    { path: '', component: Supplier },
                    { path: '/Supplier', component: Supplier },
                ] 
            },

            // 员工管理
            {  
                path: '/EmployeePage', 
                component: EmployeePage, 
                children: [
                    { path: '', component: Employee },
                    { path: '/Employee', component: Employee },
                ] 
            },
             
            // 财务管理
            {  
                path: '/FinancePage', 
                component: FinancePage, 
                children: [
                    { path: '', component: FinanceChart },
                    { path: '/FinanceChart', component: FinanceChart },
                    { path: '/FinanceCast', component: FinanceCast },
                ] 
            },
            
            // 系统设置
            {  
                path: '/SettingPage', 
                component: SettingPage, 
                children: [
                    { path: '', component: SettingPerson },
                    { path: '/SettingPerson', component: SettingPerson },
                    { path: '/SettingPassword', component: SettingPassword },
                    { path: '/SettingSystem', component: SettingSystem },
                ] 
            },
        ]
    }
)

export default router